<?php

namespace app\admin\model;

class DownloadLog extends \app\common\model\DownloadLog
{
    /**
     * 文件下载次数
     * @param $fileIds
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public static function getColumn($fileIds)
    {
        return static::field('file_id, COUNT(*) AS count')
            ->where('file_id', 'in', $fileIds)
            ->group('file_id')
            ->select()
            ->column('count', 'file_id');
    }
}